The present invention relates to compounds of formula (I), which are useful for treating disorders caused by or exacerbated by vanilloid receptor activity and pharmaceutical compositions containing compounds of formula (I). The compounds of the present invention are useful in treating pain, bladder overactivity, or urinary incontinence.